//
//  XJNet.h
//  XinJiangMall
//
//  Created by Tzyang on 2018/4/9.
//  Copyright © 2018年 Tzyang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking.h>
#import "XJHelperConfigure.h"

typedef NS_ENUM(NSInteger,XJNetType){
    XJNetTypeGet,
    XJNetTypePost
};

@interface XJNet : NSObject

/*! 初始化
 */
+ (instancetype)loadNet;

/*! 判断网络连接状态
 */

- (void)netWorkReachabilityState:(void(^)(BOOL netState))state;

/*! 数据请求
 *  @param type 请求类型
 *  @param path 请求地址
 *  @param dic 请求参数
 *  @param returnBlock 处理结果回调
 *  @param failureBlock 请求失败回调
 *  @param errorBlock 错误信息回调
 */
- (void)requestWithType:(XJNetType)type
            requestPath:(NSString *)path
             dictionary:(NSDictionary *)dic
       returnValueBlock:(XJRetureValueBlock)returnBlock
           failureBlock:(XJFailureBlock)failureBlock
         errorCodeBlock:(XJErrorCodeBlock)errorBlock;

@end
